package cn.iocoder.yudao.module.tms.dal.dataobject.accountperiodtodo;

import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 账期待办事项 DO
 *
 * @author 芋道源码
 */
@TableName("tms_account_period_todo")
@KeySequence("tms_account_period_todo_seq")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AccountPeriodTodoDO extends BaseDO {

    /**
     * 主键
     */
    @TableId
    private Long id;
    
    /**
     * 账期ID
     */
    private Long periodId;
    
    /**
     * 公司ID
     */
    private Long companyId;
    
    /**
     * 公司名称
     */
    private String companyName;
    
    /**
     * 待办类型
     * 
     * 枚举 {@link TodoTypeEnum}
     */
    private String todoType;
    
    /**
     * 待办标题
     */
    private String title;
    
    /**
     * 待办内容
     */
    private String content;
    
    /**
     * 优先级
     * 
     * 枚举 {@link PriorityEnum}
     */
    private String priority;
    
    /**
     * 状态
     * 
     * 枚举 {@link TodoStatusEnum}
     */
    private String status;
    
    /**
     * 负责人ID
     */
    private Long assigneeId;
    
    /**
     * 负责人姓名
     */
    private String assigneeName;
    
    /**
     * 截止时间
     */
    private LocalDateTime dueDate;
    
    /**
     * 完成时间
     */
    private LocalDateTime completedTime;
    
    /**
     * 完成人ID
     */
    private Long completedBy;
    
    /**
     * 完成备注
     */
    private String completedRemark;
    
    /**
     * 预警金额
     */
    private BigDecimal alertAmount;
    
    /**
     * 当前金额
     */
    private BigDecimal currentAmount;
    
    /**
     * 剩余天数
     */
    private Integer remainingDays;

    /**
     * 待办类型枚举
     */
    public enum TodoTypeEnum {
        CREDIT_ALERT("授信预警"),
        BILLING_ALERT("账期预警"),
        BILLING_OVERDUE("账期逾期");

        private final String description;

        TodoTypeEnum(String description) {
            this.description = description;
        }

        public String getDescription() {
            return description;
        }
    }

    /**
     * 优先级枚举
     */
    public enum PriorityEnum {
        LOW("低"),
        NORMAL("普通"),
        HIGH("高"),
        URGENT("紧急");

        private final String description;

        PriorityEnum(String description) {
            this.description = description;
        }

        public String getDescription() {
            return description;
        }
    }

    /**
     * 待办状态枚举
     */
    public enum TodoStatusEnum {
        PENDING("待处理"),
        PROCESSING("处理中"),
        COMPLETED("已完成"),
        CANCELLED("已取消");

        private final String description;

        TodoStatusEnum(String description) {
            this.description = description;
        }

        public String getDescription() {
            return description;
        }
    }
}
